<script setup lang="ts">

</script>

<template>
<div class="wrap">
  <div class="container">
    <div class="item">1</div>
    <div class="item">2</div>
    <div class="item">3</div>
    <div class="item">4</div>
    <div class="item">5</div>
    <div class="item">6</div>
    <div class="item">7</div>
    <div class="item">8</div>
    <div class="item">9</div>
    <div class="item">10</div>
    <div class="item">11</div>
    <div class="item">12</div>
    <div class="item">13</div>
    <div class="item">14</div>
    <div class="item">15</div>
  </div>
</div>
</template>

<style scoped lang="scss">
.wrap {
  width: 100vw;
  min-height: 100vh;
  font-family: "Exo", Arial, sans-serif;
  background-color: #557;
  color: #fff;
  display: grid;
  place-content: center;
  padding: 1rem;

  .container {
    // 显式的指定网格线名称
    --display: grid;
    display: var(--display);

    // 网格线可以有多个命名， 在中括号中填写
    grid-template-columns:[col1 col1-start] 180px
                          [col1-end col2 col2-start] 20%
                          [col2-end col3 col3-start] 10em
                          [col3-end col4 col4-start] 1fr
                          [col4-end col5 col5-start] 10vw
                          [col5-end col6 col6-start];
    grid-template-rows:  [row1 row1-start] 10em
                          [row1-end row2 row2-start] 200px
                          [row2-end row3 row3-start] 10vh
                          [row3-end row4 row4-start];

    border: 1px dashed #f36;
    box-shadow: 0 0 0 6px rgb(0 0 0 / 13%);
    border-radius: 1px;
    min-width: 80vw;

    .item {
      display: flex;
      justify-content: center;
      align-items: center;
      padding: 10px;
      background-color: #f7f7f7;
      counter-increment: item;
      border: 2px solid #2938e9;
      border-radius: 4px;
      padding: 1rem;
      color: #fff;
      font-size: 3rem;
      text-shadow: 1px 1px 0 rgba(0 0 0 /0.25);

      &:nth-child(1) {
        background-color: #f1c2c6;
      }
      &:nth-child(2n + 1) {
        background-color: #dac2f1;
      }
      &:nth-child(3n + 2) {
        background-color: #ccf1c2;
      }
      &:nth-child(4n + 3) {
        background-color: #f1c2c6;
      }
      &:nth-child(5n + 4) {
        background-color: #f1ebc2;
      }
      &:nth-child(6n - 1) {
        background-color: #3f51b5;
      }
      &:nth-child(7n - 2) {
        background-color: #810d16;
      }
      &:nth-child(8n - 3) {
       background-color: #4d0d81;
      }
      &:nth-child(9n - 4) {
        background-color: #0d4e81;
      }
      &:nth-child(10n - 5) {
       background-color: #0d815f;
      }
    }
  }
}
</style>
